//
//  YIem_SYProfileView.m
//  B段_开眼
//
//  Created by YIem on 16/5/4.
//  Copyright © 2016年 Howie. All rights reserved.
//

#import "YIem_SYProfileView.h"
#import "YIem_UIView+SYCategory.h"
@implementation YIem_SYProfileView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self setImage:[UIImage imageNamed:@"myProfile"] forState:UIControlStateNormal];
        //2. 设置文字
        [self setTitle:@"YIem" forState:UIControlStateNormal];
        
        //3. 头像圆角效果
        self.imageView.layer.cornerRadius = 35;
        self.imageView.clipsToBounds = YES;
        
        //4. 文字居中
        self.titleLabel.textAlignment = NSTextAlignmentCenter;

    
    }
    return  self;
}
- (void)layoutSubviews {
    [super layoutSubviews];
    self.imageView.width = self.width;
    self.imageView.hidden = self.width;
    self.imageView.x = 0;
    self.imageView.y = 0;
    self.titleLabel.hidden = YES;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
